import request from "../utils/request";

export function getDocuments(page = 1, pageSize = 15, categoryId = -1) {
  return request.get('/documents', {
    params: {page, pageSize, categoryId}
  })
}

export function getDocument(id) {
  return request.get('/documents/' + id);
}

export function addDocument(doc) {
  return request.post('/documents', doc);
}

export function deleteDocument(id) {
  return request.delete('/documents', {
    params: {id}
  })
}

export function updateDocument(doc) {
  return request.patch('/documents', doc);
}
